a44f5cc9a898f17130522250ce7ecb5f8d4d2f08,src/org/archicontribs/database/DBImporter.java,DBImporter,importArchimateElement,#DBModel#,351
Before Change
private void importArchimateElement(DBModel _dbModel) throws SQLException {
ResultSet result = DBPlugin.select(db, "SELECT id, documentation, folder, name, type FROM archimateelement WHERE model = ? AND version = ?", _dbModel.getProjectId(), _dbModel.getVersion());
while(result.next()) {
DBObject dbObject = new DBObject(_dbModel, IArchimateFactory.eINSTANCE.create((EClass)IArchimatePackage.eINSTANCE.getEClassifier(result.getString("type"))));
dbTabItem.setCountElements(++countElements);
dbTabItem.setProgressBar(++countTotal);
dbObject.setId(result.getString("id"), _dbModel.getProjectId(),_dbModel.getVersion());
dbObject.setName(result.getString("name"));
dbObject.setDocumentation(result.getString("documentation"));
dbObject.setFolder(result.getString("folder"));
_dbModel.indexDBObject(dbObject);
importProperties(dbObject);
}
dbTabItem.setCountElements(countElements);
After Change
private void importArchimateElement(DBModel _dbModel) throws Exception {
DBPlugin.debug(DebugLevel.MainMethod, "+Entering DBImporter.importArchimateElement()");
ResultSet result;
if ( dbSelectModel.getDbLanguage().equals("SQL") ) {
result = DBPlugin.select(db, "SELECT id, documentation, folder, name, type FROM archimateelement WHERE model = ? AND version = ?",
_dbModel.getProjectId(),
_dbModel.getVersion()
);
} else {
result = DBPlugin.select(db, "MATCH (e:archimateelement)-[:isInModel]->(m:model {model:?, version:?}) RETURN e.id as id, e.documentation as documentation, e.folder as folder, e.name as name, e.type as type",
_dbModel.getProjectId(),
_dbModel.getVersion());
}
while(result.next()) {
DBPlugin.debug(DebugLevel.Variable, "Importing "+result.getString("type")+" id="+result.getString("id")+" name="+result.getString("name"));
IArchimateElement archimateElement = (IArchimateElement)IArchimateFactory.eINSTANCE.create((EClass)IArchimatePackage.eINSTANCE.getEClassifier(result.getString("type")));
dbTabItem.setCountElements(++countElements);
dbTabItem.setProgressBar(++countTotal);
archimateElement.setId(DBPlugin.generateId(result.getString("id"), _dbModel.getProjectId(),_dbModel.getVersion()));
archimateElement.setName(result.getString("name"));
archimateElement.setDocumentation(result.getString("documentation"));
_dbModel.setFolder(result.getString("folder"),archimateElement);
_dbModel.indexEObject(archimateElement);
importObjectProperties(_dbModel, archimateElement);
}
dbTabItem.setCountElements(countElements);
dbTabItem.setProgressBar(countTotal);
DBPlugin.debug(DebugLevel.MainMethod, "-Leaving DBImporter.importArchimateElement()");
}
private void importRelationship(DBModel _dbModel) throws Exception {